package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HmzProductTypeMapper;
import com.ruoyi.system.domain.HmzProductType;
import com.ruoyi.system.service.IHmzProductTypeService;

/**
 * 产品类别Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-10
 */
@Service
public class HmzProductTypeServiceImpl implements IHmzProductTypeService 
{
    @Autowired
    private HmzProductTypeMapper hmzProductTypeMapper;

    /**
     * 查询产品类别
     * 
     * @param id 产品类别主键
     * @return 产品类别
     */
    @Override
    public HmzProductType selectHmzProductTypeById(Long id)
    {
        return hmzProductTypeMapper.selectHmzProductTypeById(id);
    }

    /**
     * 查询产品类别列表
     * 
     * @param hmzProductType 产品类别
     * @return 产品类别
     */
    @Override
    public List<HmzProductType> selectHmzProductTypeList(HmzProductType hmzProductType)
    {
        return hmzProductTypeMapper.selectHmzProductTypeList(hmzProductType);
    }

    /**
     * 新增产品类别
     * 
     * @param hmzProductType 产品类别
     * @return 结果
     */
    @Override
    public int insertHmzProductType(HmzProductType hmzProductType)
    {
        hmzProductType.setCreateTime(DateUtils.getNowDate());
        return hmzProductTypeMapper.insertHmzProductType(hmzProductType);
    }

    /**
     * 修改产品类别
     * 
     * @param hmzProductType 产品类别
     * @return 结果
     */
    @Override
    public int updateHmzProductType(HmzProductType hmzProductType)
    {
        hmzProductType.setUpdateTime(DateUtils.getNowDate());
        return hmzProductTypeMapper.updateHmzProductType(hmzProductType);
    }

    /**
     * 批量删除产品类别
     * 
     * @param ids 需要删除的产品类别主键
     * @return 结果
     */
    @Override
    public int deleteHmzProductTypeByIds(Long[] ids)
    {
        return hmzProductTypeMapper.deleteHmzProductTypeByIds(ids);
    }

    /**
     * 删除产品类别信息
     * 
     * @param id 产品类别主键
     * @return 结果
     */
    @Override
    public int deleteHmzProductTypeById(Long id)
    {
        return hmzProductTypeMapper.deleteHmzProductTypeById(id);
    }
}
